<div class="row">
	<div class="col-xs-12 col-md-12">
		<div class="widget">
			<div class="widget-header bg-blue">
				<i class="widget-icon fa fa-arrow-down"></i>
				<span class="widget-caption">使用人员管理</span>
				<div class="widget-buttons">
					<a href="#" data-toggle="maximize">
						<i class="fa fa-expand"></i>
					</a>
					<a href="#" data-toggle="collapse">
						<i class="fa fa-minus"></i>
					</a>
					<a href="#" data-toggle="dispose">
						<i class="fa fa-times"></i>
					</a>
				</div>
			</div>
			<div class="widget-body">
				<div class="table-toolbar">
					<div class="pull-left">
						<a data-loader="Ystech-loader" class="btn btn-primary" href="/Cms/Locks/order">
							<i class="fa fa-plus"></i>新增
						</a>
						
						<a id="Ystech-delall" class="btn btn-danger" href="#">
							<i class="fa fa-times"></i>删除
						</a>
						
					</div>
					<div class="pull-right">
						<form id="Ystech-search">
							<label><select name="status" class="form-control input-sm"><option value='' <eq name='status' value=''>selected</eq>>状态</option><foreach name="Think.config.STATUS" item="vo"><option value='{$key}' <eq name='status' value='$key'>selected</eq>>{$vo}</option></foreach></select></label>
							<label><select name="stype" class="form-control input-sm"><option value='1' <eq name='stype' value='1'>selected</eq>>按载体序列号【模糊查询】</option><option value='2' <eq name='stype' value='2'>selected</eq>>按载体名称【模糊查询】</option><option value='3' <eq name='stype' value='3'>selected</eq>>按用户名称【模糊查询】</option></select></label>
							<label><input name="search" type="search" class="form-control input-sm" placeholder="请输入搜索条件" value="{$Think.request.search}"></label>
							<a href="{:U('Cms/Locks/orderlist/')}" class="btn btn-success" data-loader="Ystech-loader" data-loadername="使用人员管理" data-search="Ystech-search">
								<i class="fa fa-search"></i>搜索
							</a>
						</form>
					</div>
				</div>

				<table id="Ystech-table" class="table table-bordered table-hover">
					<thead class="bordered-darkorange">
						<tr role="row">
							<th width="20px"><div class="checkbox" style="margin-bottom: 0px; margin-top: 0px;">
									<label style="padding-left: 4px;"> <input type="checkbox" class="Ystech-checkall colored-blue">
                                     <span class="text"></span>
									</label>                                    
                                </div></th>
							<th width="100px">锁序列号</th>
							<th width="100px">载体序列号</th>
							<th width="100px">载体名称</th>
							<th width="150px">用户名称</th>							
							<th width="150px">生效时间</th>
							<th width="150px">失效时间</th>
							<th width="100px">状态</th>
							<th width="200px">操作</th>
						</tr>
						</tr>
					</thead>
					<tbody>
						<volist name="cache" id="vo">
							<tr id="item{$vo.id}">
								<td>
									<div class="checkbox" style="margin-bottom: 0px; margin-top: 0px;">
										<label style="padding-left: 4px;"> <input name="checkvalue" type="checkbox" class="colored-blue Ystech-check" value="{$vo.id}">
	                                     <span class="text"></span>
										</label>                                    
	                                </div>
								</td>
								<td class=" ">{$vo.LockId}</td>
								<td class=" ">{$vo.CarrierId}</td>
								<td class=" ">{$vo.Name}</td>
								<td class=" ">{$vo.nickname}</td>
								<td class=" ">{$vo.EffectiveTime|strtotime|date='Y-m-d H:i',###}</td>
								<td class=" ">{$vo.ExpiryTime|strtotime|date='Y-m-d H:i',###}</td>
								<td class=" "><if condition="$vo['Status'] eq '1'">正常<else/>已删除</if></td>
								<td class="center ">
									<a href="{:U('Cms/Locks/order/',array('id'=>$vo['id'],'p'=>$p))}" class="btn btn-success btn-xs" data-loader="Ystech-loader" data-loadername="使用人员管理"><i class="fa fa-edit"></i> 编辑</a>&nbsp;&nbsp;
									
									<a class="btn btn-danger btn-xs del" data-id="{$vo.id}"><i class="fa fa-edit"></i> 删除</a>
								</td>
							</tr>
						</volist>
												
					</tbody>
				</table>
				<div class="row DTTTFooter">
					{$page}
				</div>
			</div>
		</div>
	</div>
</div>
<!--面包屑导航封装-->
<div id="tmpbread" style="display: none;">{$breadhtml}</div>
<script type="text/javascript">
	setBread($('#tmpbread').html());
</script>
<!--/面包屑导航封装-->
<!--全选特效封装/全部删除-->
<script type="text/javascript">
	//全选
	var checkall=$('#Ystech-table .Ystech-checkall');
	var checks=$('#Ystech-table .Ystech-check');
	var trs=$('#Ystech-table tbody tr');
	$(checkall).on('click',function(){
		if($(this).is(":checked")){			
			$(checks).prop("checked","checked");
		}else{
			$(checks).removeAttr("checked");
		}		
	});
	$(trs).on('click',function(){
		var c=$(this).find("input[type=checkbox]");
		if($(c).is(":checked")){
			$(c).removeAttr("checked");
		}else{
			$(c).prop("checked","checked");
		}		
	});
	$('#Ystech-delall').on('click',function(){
		var checks=$(".Ystech-check:checked");
		var chk=[];
		$(checks).each(function(){
			chk.push($(this).val());
		});
		if(!chk.length){
			$.Ystech.alert('danger','请选择要删除的项目！');
			return false;
		}
		var toajax="{:U('Cms/Locks/orderDel')}"+"/id/"+chk.join(",");
		var funok=function(){
			var callok=function(){
				//成功删除后刷新
				$('#refresh-toggler').trigger('click');
				return false;
			};
			var callerr=function(){
				//拦截错误
				return false;
			};
			$.Ystech.ajax('post',toajax,'nodata',callok,callerr);
		}						
		$.Ystech.confirm("确认要删除吗？",funok);
	});
	
	$('.del').on('click',function(){		
		var toajax="{:U('Cms/Locks/orderDel')}"+"/id/"+$(this).attr("data-id");
		var funok=function(){
			var callok=function(){
				//成功删除后刷新
				$('#refresh-toggler').trigger('click');
				return false;
			};
			var callerr=function(){
				//拦截错误
				return false;
			};
			$.Ystech.ajax('post',toajax,'nodata',callok,callerr);
		}						
		$.Ystech.confirm("确认要删除吗？",funok);
	});
	
</script>
<!--/全选特效封装-->